<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
<div id="root"></div>
</body>
<script>
  const app = Vue.createApp({
    template:`<div>
<input type="text" v-model="inputValue">
<button v-on:click="handleInput" :title="inputValue">增加</button>
    <ul>
      <todo-item  v-for="item of list" v-bind:content="item"></todo-item>
    </ul>
</div>`,
    data(){
      return {
        inputValue:"",
        list:[]
      }
    },
    methods: {
      handleInput(){
        this.list.push(this.inputValue);
        this.inputValue=''
      }
    }
  })
  app.component("todo-item", {
    props: ['content'],
    template: '<li>{{content}}</li>'
  })
  app.mount('#root');
</script>
</html>